﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using iLangl.Model;
using System.Threading;

namespace iLangl.BusinessModel.Actions
{
	public class GetProducts : BaseSecurityAction
	{


		public GetProducts()
			: base()
		{
			ProductsResponseContext context = new ProductsResponseContext();
			ResponseContext = context;
			context.ContextUpdated += new EventHandler(context_ContextUpdated);
		}


		private List<Product> products = null;
		public List<Product> Products
		{
			get
			{
				return products;
			}
		}

		void context_ContextUpdated(object sender, EventArgs e)
		{
			object result = ResponseContext.GetContext();

			if (result is List<Product>)
			{
				products = (List<Product>)result;
			}
		}

		protected override string GetName()
		{
			return "GetProducts";
		}

		protected override string GetVersion()
		{
			return "1";
		}
	}
}
